# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-qrcode
_pkgname=qrcode
pkgver=7.3.1
pkgrel=0
pkgdesc="QR code image generator"
url="https://github.com/lincolnloop/python-qrcode"
arch="noarch"
license="BSD-3-Clause"
depends="python3 py3-pillow py3-setuptools"
checkdepends="py3-pytest"
subpackages="$pkgname-doc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-qrcode" # Backwards compatibility
provides="py-qrcode=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	python3 setup.py build
}

check() {
	py.test-3
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	install -D -m644 "$builddir"/doc/qr.1 "$pkgdir"/usr/share/man/man1/qr.1
}

sha512sums="
9e0e508418164926a074d8c6d85419b39a36c01ac6d92415a15ce43d4aea79fa2a8d0167982f832970d2a68ec18d2b729f09e15d80b4f4c33b992999527d39f9  qrcode-7.3.1.tar.gz
"
